//
//  CJBaseRequest.h
//  DatangLife
//
//  Created by 娜 on 2018/4/19.
//  Copyright © 2018年 DatangLife. All rights reserved.
//

#import <Foundation/Foundation.h>



typedef void(^CJAPIDicCompletion)(id response, BOOL success, NSString *message);




@interface CJBaseRequest : NSObject



/** 链接*/
@property (nonatomic, copy) NSString *cj_url;
/**
 参数
 */
@property (nonatomic, copy) NSDictionary *cj_parameters;
/** 默认GET*/
@property (nonatomic, assign) BOOL cj_isPost;
/** 图片数组*/
@property (nonatomic, strong) NSArray <NSData *>*cj_imageArray;

/** 构造方法*/

+ (instancetype)cj_request;
//无参数
+ (instancetype)cj_requestWithUrl:(NSString *)cj_url;
+ (instancetype)cj_requestWithUrl:(NSString *)cj_url isPost:(BOOL)cj_isPost;

//有参数
+ (instancetype)cj_requestWithUrl:(NSString *)cj_url isPost:(BOOL)cj_isPost withParameters:(NSDictionary *)cj_parameters;


/** 开始请求，没有设置代理，或者设置了代理，需要block回调，block回调优先级高于代理*/
- (void)cj_sendRequestWithCompletion:(CJAPIDicCompletion)completion;
@end
